<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <h1>
      活动价：￥
      <span>500.00</span>
    </h1>

    <script src="./animate.js"></script>
    <script>
      var span = document.querySelector('h1 span');
      createAnimation({
        from: 500,
        to: 99,
        totalMS: 3000,
        duration: 100,
        onmove: function (n) {
          span.innerHTML = n.toFixed(2);
        },
        onend: function () {
          span.style.color = 'red';
        },
      });
    </script>
  </body>
</html>

